tui: v views the file under the cursor, under the panes - #41
Conversation
`v`, or ⏎ on a file, opens it beneath the two panes: the panes keep a fixed share of the screen and the document takes the rest. The arrows stay with the panes so the viewer follows the cursor from file to file; pgdn/pgup/space/b page the document, g/G jump, the wheel scrolls, and esc or v closes it. Remote files are read over the same SFTP session the listing came from. Markdown is rendered by @profullstack/readm3 (the readm3.com renderer) with its roles mapped onto the theme; an extensionless file that @profullstack/text-type-detection calls markdown is rendered too; other text shows as numbered lines; a binary as a hex dump of its head. Only the first megabyte is read, via a new SftpBrowser.readHead and a local equivalent, and the footer says so when that is not the whole file. Binary is a NUL in the head, or a tenth of it control bytes or invalid UTF-8: the second rule came from driving the built binary in a pty, where a 300-byte random file with no NUL rendered as garbage text. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AhtFxxWvkm4izFq8Y1RQBo
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
What
diskpush tuican now open the file under the cursor under the panes. Pressv(or⏎on a file, or click a file while the viewer is open). The panes shrink to a fixed share of the screen and the document takes the rest.escorvcloses it.It is a preview, not a detour: the arrows stay with the panes, so with a file open,
↑ ↓walk from file to file and the viewer follows.pgdn pgup(alsospace/b) page the document,g Gjump to its ends, and the wheel scrolls it. Works on local and remote panes alike; a remote file is read over the same SFTP session the listing came from.How it reads files
@profullstack/readm3— the renderer behind readm3.com and thereadm3reader — which returns role-tagged spans; readm3'scolorOfmaps them onto the TUI theme. Headings, lists, fences, quotes, links, GitHub alerts, all of it.README,NOTES) is routed by@profullstack/text-type-detection: if the house detector says markdown, it is rendered as markdown.SftpBrowser.readHead, new, and a local equivalent), so pointing the viewer at a 40 GB backup costs one megabyte. The footer saysfirst 1.0M of 40Gwhen that happens.Tests
model,document,viewandinteraction: kind detection, hex rows, head reads, the pane/document row split at 30, 18 and 12 rows, the footer position and truncation note, the layout report, wheel scrolling over the text and the scrollbar, the footer caps, and the whole flow driven throughTui—v,⏎,esc, following the cursor across a directory, paging and clamping, the remote read and its error, and a preview taking the rows back.pnpm typecheckis clean.pty.fork+ pyte) through every kind of file, paging, help, and close. That run is where the binary-detection gap was found.🤖 Generated with Claude Code
https://claude.ai/code/session_01AhtFxxWvkm4izFq8Y1RQBo